package com.novax.ex.activity.open.api;

import com.novax.ex.activity.open.model.query.MallWinnerQuery;
import com.novax.ex.activity.open.model.query.ShareContentQuery;
import com.novax.ex.activity.open.model.response.*;
import com.novax.ex.common.results.ReturnResult;
import com.novax.ex.common.util.PageQuery;
import com.novax.ex.common.util.PageUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Description 奖品池API
 * @Author zhaolei
 * @Date 2/22/23 10:54 AM
 * @Version 1.0
 */
@Tag(name = "一元购-前台展示-商品", description = "一元购-商品信息")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "MallPrizeApi", contextId = "MallPrizeApi")
@RequestMapping("/v3/public/mall/prize")
public interface MallPrizeApi {
    @Operation(summary = "列表")
    @GetMapping(value = "/list")
    ReturnResult<PageUtil<MallPrizeResponse>> list(
            @RequestHeader("language") String language,
            @RequestHeader(value = "token",required = false) String token,
            @ParameterObject @SpringQueryMap PageQuery pageQuery
    );

    @Operation(summary = "滚动消息查询")
    @GetMapping(value = "/msg/list")
    ReturnResult<List<MallMsgResponse>> msgList(
            @RequestHeader("language") String language,
            @Parameter(name = "type", description = "类型:1=参与信息,2=中奖信息,3=详情页滚动中奖信息") Integer type
    );

    @Operation(summary = "商品信息查询-按照奖品池ID查询（列表跳转）")
    @GetMapping(value = "/{id}")
    ReturnResult<MallPrizeResponse> detail(
            @RequestHeader("language") String language,
            @RequestHeader(value = "token",required = false) String token,
            @PathVariable Long id
    );

    @Operation(summary = "商品信息查询-按照商品ID查询（banner跳转）")
    @GetMapping(value = "/product/{productId}")
    ReturnResult<MallPrizeResponse> detailByProductId(
            @RequestHeader("language") String language,
            @RequestHeader(value = "token",required = false) String token,
            @PathVariable Long productId
    );

    @Operation(summary = "商品规则获取")
    @GetMapping(value = "/service")
    ReturnResult<MallServiceLanguageResponse> service(
            @RequestHeader("language") String language
    );

    @Operation(summary = "商品详情页中奖滚动消息查询")
    @GetMapping(value = "/msg/detail/list")
    ReturnResult<List<MallMsgResponse>> msgDetailList(
            @RequestHeader("language") String language,
            @Parameter(name = "mallProductId",description = "商品ID") Long mallProductId
    );

    @Operation(summary = "获取轮播")
    @GetMapping(value = "/banners")
    ReturnResult<List<MallBannerResponse>> banners(
            @RequestHeader("language") String language
    );

    @Operation(summary = "测试触发")
    @GetMapping(value = "/test")
    ReturnResult<MallServiceLanguageResponse> test(
            @Parameter(name = "type",description = "类型:1=上架,2=删除商品,3=修改价格,4=修改成本") String type,
            @Parameter(name = "id") Long id
    );

    @Operation(summary = "商品详情页-往期中奖记录")
    @GetMapping(value = "/winners")
    ReturnResult<PageUtil<MallOrderWinnerResponse>> winners(
            @RequestHeader("language") String language,
            @ParameterObject MallWinnerQuery pageQuery
    );

}
